﻿using Newtonsoft.Json.Linq;
using SDF.Core;
using SDF.Plugin.Misc.SAPAdapter.Domain;
using SDF.Plugin.Misc.SAPAdapter.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SDF.Plugin.Misc.SAPAdapter.Services
{
    public interface ISAPConnectorService
    {
        /// <summary>
        /// 测试SAP连通性
        /// </summary>
        /// <param name="sapInstance"></param>
        /// <returns></returns>
        bool Ping(string sapInstance);

        /// <summary>
        /// 执行SAP方法
        /// </summary>
        JObject ExecuteSAPFunction(string sapInstance, string functionName, JObject value);

        /// <summary>
        /// 获取RFC参数列表
        /// </summary>
        IEnumerable<FunctionParamsModel> GetFunctionParams(string sapInstance,string functionName);

        /// <summary>
        /// 获取表数据
        /// </summary>
        /// <returns></returns>
        IEnumerable<Dictionary<string, string>> GetTableData(string sapInstance, string tableName, RfcReadTableParamsModel param);

        /// <summary>
        /// 获取表结构
        /// </summary>
        /// <returns></returns>
        IEnumerable<TableInfoModel> GetTableInfo(string sapInstance, string tableName);
    }
}
